---
title: clsTaskCategoryCodeCollection
summary: API reference for clsTaskCategoryCodeCollection.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks
reference_type: embedded
---

# clsTaskCategoryCodeCollection

`clsTaskCategoryCodeCollection` loads and holds every `TASK_CATEGORY_CODE` row for a given source system, and reports whether any categories exist for that source system via an `IsValid` override.

## Purpose
- Retrieve all category codes for a source system, ordered by description, for UI lookup lists ([SQL-007](../../sql/SQL-007-select-task-category-code-list.md)).
- Signal via `IsValid` whether the requested source system has any registered categories at all ([BR-024](../../business-rules.md#br-024-a-category-code-collection-is-valid-only-if-at-least-one-row-was-found)).

## Context
- Namespace: `SAIF.Business.Tasks`
- Assembly/package: `SAIF.Business.Tasks` (embedded in the `LegalMaintenance` web deployment)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `TaskSourceCode` | `Property TaskSourceCode As String` | The source system scoping this collection's retrieval. |
| `IsValid` | `Overrides ReadOnly Property IsValid As Boolean` | Returns `True` only when at least one category row was returned (`m_DataFound`), signaling the source system has registered categories ([BR-024](../../business-rules.md#br-024-a-category-code-collection-is-valid-only-if-at-least-one-row-was-found)). |
| `GetCodes` | `Shared Function GetCodes(dpi As IDataPortalInfo, inTaskSourceCode As String) As clsTaskCategoryCodeCollection` | Factory/retrieval entry point that loads all category codes for a source system ([SQL-007](../../sql/SQL-007-select-task-category-code-list.md)). |
| `Criteria` | `Friend Class Criteria` (nested, implements `IBusinessCriteria`) | Read-only criteria for this code table; write-SQL properties throw `ApplicationException(clsConstants.Messages.InvalidSQLProperty)` ([BR-023](../../business-rules.md#br-023-code-tables-are-read-only-reference-data)). |

## Behavioral notes
- The class is `<Serializable()>`, consistent with remoting/session persistence of BOF objects across the web tier*.
- `AfterRetrieve` sets `m_DataFound = True` per row loaded, which `IsValid` reads.

## Constraints and usage notes
- Any attempt to use `CreateSQL`/`InsertSQL`/`UpdateSQL`/`DeleteSQL` on this type's `Criteria` throws `ApplicationException(clsConstants.Messages.InvalidSQLProperty)` ([BR-023](../../business-rules.md#br-023-code-tables-are-read-only-reference-data)).

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [API index](../index.md)
- [clsTaskCategoryCode](clsTaskCategoryCode.md)
- [Business rules](../../business-rules.md)

## Sources
- SAIF.Business.Tasks/clsTaskCategoryCodeCollection.vb
